package com.maysev.myjob_backend.common;

import lombok.extern.slf4j.Slf4j;
import org.apache.tomcat.util.http.fileupload.FileUploadBase;
import org.apache.tomcat.util.http.fileupload.impl.FileSizeLimitExceededException;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MaxUploadSizeExceededException;
import org.springframework.web.multipart.MultipartException;

import java.sql.SQLIntegrityConstraintViolationException;

/**
 * @author 五七
 * @create 2023-02-26 16:57
 * @description:
 */
//AOP 通知
@ControllerAdvice
//给页面响应信息
@ResponseBody

@Slf4j
public class GlobalExceptionHandler {

    /**
     * 异常处理方法
     * @param ex
     * @return
     */
//    @ExceptionHandler(value = MultipartException.class)
//    public R<String> exceptionHandler(MaxUploadSizeExceededException   ex){
//        log.info("进入处理文件大小异常");
//
//        return R.error("失败");
////        return R.error("文件大小不可以超过2MB");
//
//    }


}
